# print(",".join([f"https://c.qsxt.info/cdn/qsxt/course/2380/video/{x}.mp4?qsEncoded=true,{x}.mp4" for x in range(4,146)]))
# for x in range(4,146):
#     print(f"https://c.qsxt.info/cdn/qsxt/course/2380/video/{x}.mp4?qsEncoded=true,{x}.mp4")
import json
from urllib.parse import unquote
text = '''
{
    "data": {
        "id": "640ebcc446e0fb000725974a",
        "name": "网络安全",
        "nodes": [
            {
                "id": "jbxx",
                "name": "基本信息",
                "type": "chapter",
                "url": null,
                "slides": null,
                "nodes": [
                    {
                        "id": "jbxx_1",
                        "name": "课程简介",
                        "type": "html",
                        "url": null,
                        "slides": null,
                        "nodes": null
                    },
                    {
                        "id": "jbxx_2",
                        "name": "教学大纲",
                        "type": "html",
                        "url": null,
                        "slides": null,
                        "nodes": null
                    },
                    {
                        "id": "jbxx_3",
                        "name": "教师简介",
                        "type": "html",
                        "url": null,
                        "slides": null,
                        "nodes": null
                    }
                ]
            },
            {
                "id": "kcjs",
                "name": "课程讲授",
                "type": "chapter",
                "url": null,
                "slides": null,
                "nodes": [
                    {
                        "id": "kcjs_1",
                        "name": "第一章引言",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_1_1",
                                "name": "1.1.1 国内外网络空间安全现状",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_1_2",
                                "name": "1.1.2 网络空间对抗经典战例",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_2",
                        "name": "第二章计算机网络基础",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_2_1",
                                "name": "2.1.1 计算机网络的定义和体系结构概要",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_2_2",
                                "name": "2.2.1 计算机网络体系结构和OSI参考模型",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_2_3",
                                "name": "2.2.2 计算机网络体系结构和TCPIP参考模型",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_2_4",
                                "name": "2.3.1 Internet基本知识",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_3",
                        "name": "第三章Internet协议的安全性",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_3_1",
                                "name": "3.1.1 Internet协议概述",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_3_2",
                                "name": "3.2.1 传输层协议",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_3_3",
                                "name": "3.2.2 应用层协议1",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_3_4",
                                "name": "3.2.3 应用层协议2",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_4",
                        "name": "第四章单(私)钥密码体制",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_4_1",
                                "name": "4.1.1 密码体制的定义与古典密码",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_4_2",
                                "name": "4.2.1 流密码及其软硬件实现",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_4_3",
                                "name": "4.3.1 数据加密标准",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_4_4",
                                "name": "4.3.2 高级加密标准",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_5",
                        "name": "第五章双(公)钥密码体制",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_5_1",
                                "name": "5.1.1 双钥密码体制的基本概念",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_5_2",
                                "name": "5.1.2 RSA公钥密码算法",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_5_3",
                                "name": "5.1.3 ElGamal密码体制",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_5_4",
                                "name": "5.2.1 DH公钥密码体制",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_5_5",
                                "name": "5.2.2 椭圆曲线密码体制",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_5_6",
                                "name": "5.2.3 中国商用密码SM2",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_6",
                        "name": "第六章消息认证与杂凑函数",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_6_1",
                                "name": "6.1.1 杂凑函数的概念",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_6_2",
                                "name": "6.2.1 杂凑函数的应用",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_6_3",
                                "name": "6.2.2 应用杂凑函数的基本方式",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_7",
                        "name": "第七章数字签名",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_7_1",
                                "name": "7.1.1 数字签名基本概念、RSA和ElGamal签名体制",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_7_2",
                                "name": "7.2.1 Schnorr、DSS和中国商用签名体制SM2",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_7_3",
                                "name": "7.3.1 具有特殊功能的数字签名体制及数字签名应用",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_8",
                        "name": "第八章密码协议",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_8_1",
                                "name": "8.1.1 协议的基本概念",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_8_2",
                                "name": "8.2.1 安全协议分类与密钥建立协议",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_8_3",
                                "name": "8.2.2 安全协议分类与认证协议",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_8_4",
                                "name": "8.3.1 秘密分拆协议与协议安全性分析",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_9",
                        "name": "第九章数字证书与公钥设施",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_9_1",
                                "name": "9.1.1 PKI的基本概念",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_9_2",
                                "name": "9.2.1 数字证书与网络安全",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_9_3",
                                "name": "9.2.2 数字证书与公钥基础设施",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_10",
                        "name": "第十章网络加密与密钥管理",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_10_1",
                                "name": "10.1.1 网络加密",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_10_2",
                                "name": "10.2.1 密钥管理概念与密钥生成",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_10_3",
                                "name": "10.2.2 密钥分配",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_10_4",
                                "name": "10.2.3 密钥保护等环节",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_11",
                        "name": "第十一章无线网络安全",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_11_1",
                                "name": "11.1.1 无线网络面临的安全威胁与2G蜂窝网络的安全性",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_11_2",
                                "name": "11.2.1 3G与4G蜂窝网络的安全性",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_11_3",
                                "name": "11.3.1 5G蜂窝网络的安全性与6G技术的发展趋势",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_12",
                        "name": "第十二章防火墙技术",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_12_1",
                                "name": "12.1.1 防火墙概述",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_12_2",
                                "name": "12.2.1 包过滤防火墙",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_12_3",
                                "name": "12.2.2 应用网关防火墙",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_13",
                        "name": "第十三章入侵检测技术",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_13_1",
                                "name": "13.1.1 入侵检测原理、主要方法、结构及分类",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_13_2",
                                "name": "13.2.1 NIDS、HIDSDIDS简介及IDS发展方向",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    },
                    {
                        "id": "kcjs_14",
                        "name": "第十四章VPN技术",
                        "type": "chapter",
                        "url": null,
                        "slides": null,
                        "nodes": [
                            {
                                "id": "kcjs_14_1",
                                "name": "14.1.1 VPN概述",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_14_2",
                                "name": "14.2.1 IPSecVPN与SSLVPN",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            },
                            {
                                "id": "kcjs_14_3",
                                "name": "14.3.1 PPTPVPN与MPLSVPN",
                                "type": "video",
                                "url": null,
                                "slides": null,
                                "nodes": null
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "message": "成功",
    "extraData": null,
    "hr": 0
}
'''
# print([x for x in json.loads(text)["data"]["nodes"][1]["nodes"][0]["nodes"]][0])
# print([f"https://c.qsxt.info/cdn/hbkjdx/course/054/video/{x1['name']}.mp4?qsEncoded=true" for x1 in json.loads(text)["data"]["nodes"][1]["nodes"][0]["nodes"]][0])
# print(unquote("https://c.qsxt.info/cdn/hbkjdx/course/054/video/4.5%20%20IP%20%E6%95%B0%E6%8D%AE%E6%8A%A5%E7%9A%84%E6%A0%BC%E5%BC%8F%20.mp4?qsEncoded=true"))
# print([f"https://c.qsxt.info/cdn/qsxt/course/1244/video/[{x['name'][:3]}.1]--{x['name'].replace(' ','')} 00_00_04-.mp4?qsEncoded=true" for x in json.loads(text)["data"]["nodes"][1]["nodes"][0]["nodes"]][1])
# print(unquote("https://c.qsxt.info/cdn/qsxt/course/1244/video/%5B6.4.2%5D--6.4%E8%AF%AD%E6%B3%95%E5%88%B6%E5%AF%BC%E7%BF%BB%E8%AF%91%E5%99%A8%E7%9A%84%E5%AE%9E%E7%8E%B0%EF%BC%88%E4%B8%8B%EF%BC%89%2000_00_04-.mp4?qsEncoded=true"))

for x in json.loads(text)["data"]["nodes"][1]["nodes"]:
    for x1 in x["nodes"]:
        print(f"https://c.qsxt.info/cdn/hbkjdx/course/054/video/{x1['name']}.mp4?qsEncoded=true,{x1['name']}.mp4")